# set state to state of container
obj = state_change.object
freeStatus = False
if obj.price == None or obj.price == 0.0:
    freeStatus = True
wf = context.portal_workflow
for item in obj.objectValues():
    try:
        if freeStatus == True:
            wf.doActionFor(item, 'publish')
        else:
            wf.doActionFor(item, 'paypublish')
    except:
        continue
